﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Xylee.Common
{
    public class NavigationException : ApplicationException
    {
        public NavigationException(string message) : base(message) { }
    }

    /// <summary>
    /// Refers to any unavailable navigation exception that occurs 
    /// in the navigation class. This is used whenever an attempt 
    /// is made to navigate to a portal that may not exist within 
    /// the current context or any context for that matter.
    /// <remarks>Use <seealso cref="NavigateType"/> when refering 
    /// to actual navigation (i.e.) back, forward, close... etc.</remarks>
    /// </summary>
    public class NavigationUnavailableException : NavigationException
    {
        private NavigateType type;

        public NavigationUnavailableException(NavigateType type, string message) : base(message)
        {
            this.type = type;
        }

        public NavigationUnavailableException(string message) : base(message) { }

        /// <summary>
        /// Returns the type of navigation attempted in the stack.
        /// </summary>
        public NavigateType NavigationAttempted
        {
            get { return this.type; }
        }
    }

    /// <summary>
    /// Defines the type of navigation that 
    /// is occuring in the system. Used in 
    /// exception handling.
    /// </summary>
    public enum NavigateType
    {
        Forward,
        Back,
        Activate
    }
}
